package com.example.common;


/*
@description:
@ClassName ResultUtils
@author chen
@create 2025-07-12 20:15
@Version 1.0
*/
public class ResultUtils
{
    public static <T> Result<T> success()
    {
        return new Result<>(true, null, null);
    }

    public static <T> Result<T> success(T data)
    {
        return new Result<>(true, data, null);
    }

    public static <T> Result<T> error(String msg)
    {
        return new Result<>(false, null, null, msg);
    }

    public static <T> Result<T> error(String code, String msg)
    {
        return new Result<>(false, null, code, msg);
    }
}
